﻿using Awsc.DataAcquisitionSys.Core.Databases;
using Awsc.DataAcquisitionSys.Core.Model;

namespace Awsc.DataAcquisitionSys.Core.Models.POCO
{
    public class WearPart : EntityBase
    {
        public string Description { get; set; }
        public WearPartStatus Status { get; set; } = WearPartStatus.Normal;
        public DateTime? LastMaintenanceDate { get; set; }
        public double UsageCount { get; set; }
        public double FactoryCount { get; set; }
        public double UsagePercent
        {
            get
            {
                if (FactoryCount == 0)
                {
                    return 0;
                }
                return Math.Round((UsageCount / FactoryCount) * 100, 2);
            }
        }
    }

    public enum WearPartStatus
    {
        Normal = 0,
        Disabled = 1
    }
}
